<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateConfAgentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('conf_agents', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('user_id')->comment('代理用户id');
			$table->string('name', 64)->comment('代理名称');
			$table->string('pay_type', 64)->nullable()->comment('提款到账方式');
			$table->string('account', 64)->nullable()->comment('提款到账账号');
			$table->string('account_address', 128)->nullable()->comment('开户地址（银行卡必须）');
			$table->string('account_real_name', 64)->nullable()->comment('开户真实名');
			$table->decimal('rate', 5, 4)->unsigned()->default(0.0000)->comment('比率');
			$table->decimal('score_rate', 5, 4)->default(0.0000)->comment('加分比率，所属网站加分最高比率');
			$table->decimal('money', 13, 4)->unsigned()->default(0.0000)->comment('余额');
			$table->integer('status')->default(0)->comment('启用状态 0:禁用；1：启用');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('conf_agents');
	}

}
